<div id="content">
    <div class="row s_page_title">
        <sa-big-breadcrumbs [items]="['流向管控','流向管控配置']" icon="fa fa-retweet" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
    </div>
    <sa-widgets-grid>
        <div class="s_table">
            <div sa-widget [editbutton]="false" color="darken" class="clearfix">
                <header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
                    <h2>流向管控配置</h2>
                </header>
                <div>
                    <div class="widget-body no-padding">
                        <div class="page-header clearfix s_table_opreation">
                            <div class="left page-header-btn">
								<!-- <sa-company-tree-car companyTreeId="companyTree" wrapId="content" [isShowCarSort]="false" [isShowCarNum]="false" (companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">进厂状态</span>
									<select name="" class="top_module_select" [(ngModel)]="state">
										<option value="">全部</option>
										<option value="1">已限制进厂记录</option>
										<option value="2">全部记录</option>
									</select>
								</div>
								<div class="top_module top_module_box">
									<span class="top_module_label module_text">是否启用</span>
									<select name="" class="top_module_select" [(ngModel)]="isOpen">
										<option value="">全部</option>
										<option value="0">不启用</option>
										<option value="1">启用</option>
									</select>
								</div> -->
                                <!-- <button type="button" class="btn btn-primary" (click)="tableSearch()">查询</button> -->
                                <button type="button" class="btn btn-primary" (click)="showAddLimitModal(subjectManageModal)">添加</button>
                                <!-- <button type="button" class="btn btn-primary" (click)="showImportModal(weightModal)">批量导入</button> -->
                                <!-- <button type="button" class="btn btn-primary" (click)="exportData()">导出</button> -->
                            </div>
                            <div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="tableSearch()" class="search-input" placeholder="项目名称、描述">
								<span class="top-search-box">
									<button class="top-search-btn" type="button" (click)="tableSearch()"> <i class="fa fa-search"></i></button>
								</span>
							</div>
                        </div>
                        <div class="table_scroll">
                            <table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
                                <thead>
                                    <tr>
                                        <th>项目名称</th>
                                        <th>项目公司</th>
                                        <th>分配角色</th>
                                        <th>启用小程序</th>
                                        <th>项目类型</th>
                                        <th>部署情况</th>
                                        <th>描述</th>
                                        <th>配置</th>
                                        <th>修改人</th>
                                        <th>修改时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr *ngFor="let row of tableData" [ngClass]='{selected: activeSelected === row.id }'>
                                        <td>{{row.projectName}}</td>
                                        <td>{{row.companyName}}</td>
                                        <td>{{row.roleName}}</td>
                                        <td>{{row.isEnable?"启用":"不启用"}}</td>
                                        <td>{{row.projectType=='1'?'GPS':"GPS+载重"}}</td>
                                        <td>{{row.deploy}}</td>
                                        <td>{{row.description}}</td>
                                        <td>{{row.config}}</td>
                                        <td>{{row.updateUserName}}</td>
                                        <td>{{row.updateTime}}</td>
                                        <!-- 这里也根据权限 -->
                                        <td>
                                            <button type="button" (click)="editRow(row,subjectManageModal)">编辑</button>
                                            <button *ngIf="isShowDelete" type="button" (click)="del_domCode(row)">删除</button>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="table-fix clearfix">
                            <paginator [totalRecords]="totalCounts" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
                            </paginator>
                            <button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </sa-widgets-grid>
</div>

<!-- 新增项目管理 -->
<section bsModal #subjectManageModal="bs-modal" class="modal fade addRenewal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content" style="width: 670px;">
            <div class="modal-header">
                <button type="button" class="close" (click)="closeSubjectManageModal(subjectManageModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">{{formType=="add"?'新增':'编辑'}}项目</h4>
            </div>
            <div class="modal-body">
                <form id="subjectManage" class="form-horizontal" role="form" novalidate="novalidate" [saBootstrapValidator]="validatorOptions">
                    <div class="row form-horizontal">

                        <div class="form-group clearfix">
                            <label class="control-label col-sm-2 no-padding-right">项目名称<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="projectName" autocomplete="off" type="text" [(ngModel)]='subjectManageObj.projectName'  placeholder="填写项目名称" />
                                </div>
                            </div>
                        </div>

                        <div class="form-group clearfix">
                            <label class="control-label col-md-2 col-sm-2 no-padding-right">项目公司<sup>*</sup></label>
                            <div class="col-sm-9">
                                <input class="form-control none" id="selectedCompanyName3" name="selectedCompanyName3" [(ngModel)]="subjectManageObj.companyName"/>
                                <sa-company-tree [Height]="32" [companyNameValue]="selectedCompanyName3" [companyIdValue]="selectedCompanyId3" companyTreeId="companyTree7" (companySelected)="factorySelected($event)"></sa-company-tree>
                            </div>
                        </div>

                        <div class="form-group clearfix">
                            <label class="control-label col-sm-2 no-padding-right">分配角色<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="roleName" autocomplete="off" type="text" [(ngModel)]='subjectManageObj.roleName' placeholder="填写角色" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-2 no-padding-right">项目类型<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control none" name="projectType" [(ngModel)]="subjectManageObj.projectType"/>
                                    <select class="form-control" id="typeSelect" (change)="selectChange($event)">
										<option value="">请选择</option>
										<option value="2">GPS+载重</option>
										<option value="1">GPS</option>
									</select>
                                    <!-- <input class="form-control" name="maxTotalDay" autocomplete="off" type="text" [(ngModel)]='subjectManageObj.projectType' placeholder="填写项目类型" /> -->
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-2 no-padding-right">部署情况<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="deploy" autocomplete="off" type="text" [(ngModel)]='subjectManageObj.deploy' placeholder="填写部署情况" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-2 no-padding-right">描述<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <input class="form-control" name="description" autocomplete="off" type="text" [(ngModel)]='subjectManageObj.description' placeholder="填写描述" />
                                </div>
                            </div>
                        </div>
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-2 no-padding-right">配置<sup>*</sup></label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <textarea class="form-control" type="text" style="resize: vertical;" [(ngModel)]='subjectManageObj.config' name='config' placeholder='请填写配置;格式例如：{orderUrl:"...",pictureUrl:"..."}'></textarea>
                                </div>
                            </div>
                        </div>
                        
                        <div class="form-group clearfix">
                            <label class="control-label col-sm-2 no-padding-right">启用小程序</label>
                            <div class="col-sm-9">
                                <div class="clearfix">
                                    <label class="col-sm-4"><input type="radio" class="radioSales" name="isEnable" value="1" (click)="clickCheck(1)" style="margin-right: 10px" [checked]="isCheck" />启用</label>
									<label class="col-sm-4"><input type="radio" class="radioSales" name="isEnable" value="0" (click)="clickCheck(0)" style="margin-right:10px" [checked]="!isCheck" />不启用</label>
                                    <!-- <input class="form-control" name="isOpen" autocomplete="off" type="text" [(ngModel)]='subjectManageObj.isOpen' placeholder="填写是否启用" /> -->
                                </div>
                            </div>
                        </div>

                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" (click)="closeSubjectManageModal(subjectManageModal)">取消</button>
                <button type="button" class="btn btn-primary" (click)="submitModal(subjectManageModal)">提交</button>
            </div>
        </div>
    </div>
</section>
<!-- 新增项目管理 结束 -->